    package com.ruoyi.web.controller.project;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.project.domain.entity.Project;
import com.ruoyi.project.domain.entity.ProjectAttachment;
import com.ruoyi.project.domain.entity.ProjectPay;
import com.ruoyi.project.domain.query.ProjectFileQuery;
import com.ruoyi.project.domain.query.ProjectPayQuery;
import com.ruoyi.project.service.IProjectAttachmentService;
import com.ruoyi.project.service.IProjectPayService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

    @RestController
    @RequestMapping("/project/pay")
    @Api(tags = "附件信息", description = "附件信息")
    public class ProjectFPayController {


        @Resource
        private IProjectPayService payService;

        @ApiOperation("分页")
        @GetMapping(value = "/list")
        public R getList(ProjectPayQuery query) {
            return R.ok(payService.getList(query));
        }



        @ApiOperation("新增")
        @PostMapping(value = "/save")
        public R add(@RequestBody ProjectPay project) {
            return R.ok(payService.addInfo(project));
        }


        @ApiOperation("修改")
        @PutMapping (value = "/update")
        public R update(@RequestBody ProjectPay project) {
            return R.ok(payService.updateInfo(project));
        }


        @ApiOperation("修改")
        @PutMapping (value = "/updateIds")
        public R updateIds(@RequestBody ProjectPay project) {
            return R.ok(payService.updateIds(project));
        }



        @ApiOperation("删除")
        @DeleteMapping (value = "/{id}")
        public R delete(  @PathVariable("id") String id) {
            return R.ok(payService.deleteInfo(id));
        }



        @ApiOperation("详情")
        @GetMapping(value = "/details")
        public R<ProjectPay> getDetails(@RequestParam String id) {
            ProjectPay byId = payService.getById(id);
            return R.ok(byId);
        }


    }
